package com.pristine.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class HelloWorldController {
	String message = "Welcome to Spring MVC!";

	@RequestMapping("/hello")
	public ModelAndView showMessage(
			@RequestParam(value = "name", required = false, defaultValue = "World") String name) {
		System.out.println("in controller");

		ModelAndView mv = new ModelAndView("helloworld");
		mv.addObject("message", message);
		mv.addObject("name", name);
		return mv;
	}
	
	
	
	@RequestMapping("/textbutton")
    public String getTextbutton(ModelMap modelMap) {
        return "textbutton";
    }
	@RequestMapping("/page1")
	public String getPage1(ModelMap modelMap) {
        return "page1";
    }
	@RequestMapping("/dataiteration")
	public String getDataiteration(ModelMap modelMap) {
        return "dataiteration";
    }
	
	@RequestMapping("/contactcontroller")
	public String getContactcontroller(ModelMap modelMap) {
        return "contactcontroller";
    }
}